372555029f3123a6674e287bdc312324e2f81320,src/test/java/org/lmdbjava/TutorialTest.java,TutorialTest,tutorial5,#,349

Before Change


  public void tutorial5() throws IOException {
    // The critical difference is we pass the PROXY_MDB field to Env.create().
    // There's also a PROXY_SAFE if you want to stop ByteBuffer's Unsafe use.
    Env<MutableDirectBuffer> env = create(PROXY_MDB);

    // Aside from that and a different type argument, it's the same as usual...
    File path = tmp.newFolder();
    env.setMapSize(700 * 700);
    env.setMaxDbs(1);
    env.open(path, 0664);
    Dbi<MutableDirectBuffer> db = env.openDbi("my DB", MDB_CREATE);

    MutableDirectBuffer key = new UnsafeBuffer(allocateDirect(511));

After Change


    // There's also a PROXY_SAFE if you want to stop ByteBuffer's Unsafe use.
    // Aside from that and a different type argument, it's the same as usual...
    File path = tmp.newFolder();
    Env<MutableDirectBuffer> env = create(PROXY_MDB)
      .setMapSize(700 * 700)
      .setMaxDbs(1)
      .open(path, 0664);

    Dbi<MutableDirectBuffer> db = env.openDbi("my DB", MDB_CREATE);